# -*- coding: utf-8 -*-
# @Time    : 2023/6/5 10:06
# @Author  : 刘张宇
# @Email   : 2285524065@qq.com
# @File    : .py
# @Software: PyCharm

from appium.webdriver.common.mobileby import MobileBy as By
from pages.base_page import BasePage

class Purse(BasePage):
    purse_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/dt_wallet"]')#点击钱包定位器
    coupons_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/tablayout"]/android.widget.LinearLayout[1]/androidx.appcompat.app.ActionBar-Tab[1]')#点击折扣卷定位器
    title_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/tablayout"]/android.widget.LinearLayout[1]/androidx.appcompat.app.ActionBar-Tab[1]/android.widget.TextView[1]')


    def menu_purse(self):
        self.find_element(self.purse_locator).click()#点击钱包

    def menu_coupons(self):
        self.find_element(self.coupons_locator).click()#点击折扣卷

    def task_first(self):
        current_task = self.find_element(self.title_locator).text()#优惠劵
        return current_task
